<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix = "fn" uri ="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" href="<%=request.getContextPath()%>/image/LOGO.png" type="image/x-icon" />
<title>打印登记</title>

</head>

<body> 
 <div class="easyui-layout" data-options="fit:true" style="width:100%;height:100%;border:0;">
      <div data-options="region:'north'" class="north-min" style="border-left:0">
        	<span class="paddingTBL">
	      		<label class="shootFontBold">申请病案</label>&nbsp;&nbsp;
	      		<label>病案号:</label><span class="shootFontBold register_fprn" ></span>&nbsp;&nbsp;
				<label>姓名:</label><span class="shootFontBold register_fname"></span>&nbsp;&nbsp;
	      		<label>性别:</label><span class="shootFontBold register_fsex" ></span>&nbsp;&nbsp;
				<label>出院日期:</label><span class="shootFontBold register_fcydate" ></span>&nbsp;&nbsp;
				<label>身份证号:</label><span class="shootFontBold register_fidcard"></span>&nbsp;&nbsp;
				<label></label><span class="shootFontBold register_fzyid" style="display:none;"></span>
				<label></label><span class="shootFontBold register_frydate" style="display:none;"></span>
				<label></label><span class="shootFontBold register_fcybs" style="display:none;"></span>
				<label></label><span class="shootFontBold register_fcydept" style="display:none;"></span>
				<label></label><span class="shootFontBold register_ftimes" style="display:none;"></span>
      	   </span>
       </div>
      	
       <div data-options="region:'west',collapsible:false,title:'申请信息'"  style="height:100%;width:63%;" class="Cancel_borderLB">
            <object type="application/cert-reader"  id="plugin" width=0 height=0> </object>
		    <%-- <table style="width:100%;" cellspacing="10">
				 <tr style="">
					<!-- <td class="shootFontBold">申请信息</td> -->
					<td colspan="4"><font id="ret"></font></td>
				 </tr>  
				 <tr>
					<td >是否本人</td>
					<td>
						<select id="IsSelf" class="easyui-combobox" style="width:140px;">
							<option value="0" selected="selected">是</option>
		               		<option value="1" >否</option>
		               	</select>  
					</td>
					<td>是否打印</td>
					<td>
						<select id="" class="easyui-combobox" style="width:60px;">
							<option value="0" selected="selected">打印</option>
		               		<option value="1" >复印</option>
		               	</select> 
					    &nbsp;&nbsp;色彩 
						<select id="" class="easyui-combobox" style="width:55px;">
							<option value="0" selected="selected">黑白</option>
		               		<option value="1" >彩色</option>
		               	</select>
					</td>
			    </tr>  
				<tr class="dlr">
					<td>代理人身份证</td>
					<td><input type="text" id="printRegister_IDCard" class="easyui-textbox" data-options="editable:false,width:140,height:24"> 
					    <span class="paddingL"></span>
					</td>
					<td>代理人姓名</td>
					<td><input type="text" id="printRegister_fname" class="easyui-textbox" data-options="editable:false,width:160,height:24"></td>
				</tr>
			  
				<tr class="dlr">
					<td>代理人地址</td>
					<td><input type="text" id="printRegister_address" class="easyui-textbox" data-options="editable:false,width:140,height:24"></td>
					<td>联系电话</td>
					<td><input type="text" id="printRegister_phone" class="easyui-textbox" data-options="width:160,height:24"></td>
				</tr>
				  
				<tr>
					<td>与患者关系</td>
					<td>
						<input type="text" id="printRegister_relation" class="" data-options="width:140,height:24">
					</td>
					<td class="lable">打印类型</td>
	                <td><input class="" type="text" id="printRegister_type" name="" data-options="width:160,height:24" /></td>
				</tr>
				<tr>
					<td>打印目的</td>
					<td>
						<select class="easyui-combobox" id="printRegister_purpose" name="" data-options="width:140,height:24">
							<option value="1">费用报销</option>
		               		<option value="2">方便日后查阅</option>
		               	</select>
					</td>
					<td class="">打印份数</td>
					<td>
					  <input id="print_Copies" class ="easyui-numberbox" data-options ="width:140,height:24,min:1,panelHeight:'auto',readonly:false"/>
					  <label>份</label>
					</td>
				</tr>
				 
				<tr>
					<td style="padding-left:5px;border:1px solid #dad9d9;border-right:0;">打印内容</td>
					<td colspan="3">
						<table  style="margin-left:-10px;border:1px solid #dad9d9;border-left:0;width:100%;">
							<c:forEach items="${contentModel}" var="model" varStatus="status" begin = "0" end = "29">
								<c:choose>
									<c:when test="${status.index%3 == 0 }">
										<tr>
									</c:when>
								</c:choose>
								<c:choose>
									<c:when test="${(status.index+1)%3 == 0 }">
										<td class="print_td">
											<label class="">
												<input type="checkbox" id="content_<c:out value="${model.FZJC }"/>" name="Model" value="<c:out value="${model.FZJC }"/>">
												<span class="print_text"><c:out value="${model.FXMMC }"/></span>
											</label>
										</td>
										</tr>
									</c:when>
								<c:otherwise>
									<td class="print_td">
										<label class="">
											<input type="checkbox" id="content_<c:out value="${model.FZJC }"/>" name="Model" value="<c:out value="${model.FZJC }"/>">
											<span class="print_text"><c:out value="${model.FXMMC }"/></span>
										</label>
									</td>
								</c:otherwise>
								</c:choose>
							</c:forEach>
						</table>
					</td>
				</tr>
				<tr>
					<td colspan=4 style="text-align:center;">
					     <a href="#" class="easyui-linkbutton" onclick="printPage()">打印申请单</a>&nbsp;&nbsp;
					     <a href="#" class="easyui-linkbutton" onclick="register()">确认登记</a>&nbsp;&nbsp;
					     <a href="#" id="" class="easyui-linkbutton" onclick="readCert()">读 卡</a>&nbsp;&nbsp;
					     <!-- <a href="#" class="easyui-linkbutton" id="" onClick="openChargeDialog()" style="">收 费</a> -->
						<!-- <span class="paddingL"></span><a href="#" class="easyui-linkbutton" onclick="returnQuery()">返 回</a> -->
					</td>
				</tr>
		 </table>  
		  --%>
		  
		    <table style="width:100%;" cellspacing="10">
				 <tr style=""> 
					<td colspan="4"><font id="ret"></font></td>
				 </tr>  
				 <tr> 
					<td>是否打印</td>
					<td>
						<input type="radio" checked="checked" name="dy" value="0" />打印
						<span class="paddingbtn"></span>
						<input type="radio" name="dy" value="1" />复印
		            </td>
		            <td>色&nbsp;&nbsp;彩</td>
		            <td>
						 <input type="radio" checked="checked" name="sc" value="0">黑白
						 <span class="paddingbtn"></span>
						 <input type="radio" name="sc" value="0">彩色
					</td>
			    </tr>  
				
				<tr>
			    	<td><span class="star-sty">*</span>申请者</td>
					<td>
						<input type="text" id="printRegister_fname" class="easyui-textbox"  data-options="width:160,height:24">
					</td>
					<td><span class="star-sty">*</span>与患者关系</td>
					<td>
						<input type="text" id="printRegister_relation" class="" data-options="width:160,height:24">
					</td>
				</tr> 
				
				<tr>
					<td>联系电话</td>
					<td><input type="text" id="printRegister_phone" class="easyui-textbox" data-options="width:160,height:24"></td>
				    <td>打印类型</td>
	                <td><input class="" type="text" id="printRegister_type" name="" data-options="width:160,height:24" /></td>
				</tr>   
				 
				<tr>
					<td>打印目的</td>
					<td>
						<select class="easyui-combobox" id="printRegister_purpose" name="" data-options="width:160,height:24">
							<option value="1">费用报销</option>
		               		<option value="2">方便日后查阅</option>
		               	</select>
					</td>
					<td>打印份数</td>
					<td>
					  <input id="print_Copies" class ="easyui-numberbox" data-options ="width:140,height:24,min:1,panelHeight:'auto',readonly:false"/>
					  <label>份</label>
					</td>
				</tr>
				
				<tr>
					<td style="padding-left:5px;border:1px solid #dad9d9;border-right:0;">打印内容</td>
					<td colspan="3">
						<table  style="margin-left:-10px;border:1px solid #dad9d9;border-left:0;width:95%;">
							<c:forEach items="${contentModel}" var="model" varStatus="status" begin = "0" end = "29">
								<c:choose>
									<c:when test="${status.index%3 == 0 }">
										<tr>
									</c:when>
								</c:choose>
								<c:choose>
									<c:when test="${(status.index+1)%3 == 0 }">
										<td class="print_td">
											<label class="">
												<input type="checkbox" id="content_<c:out value="${model.FZJC }"/>" name="Model" value="<c:out value="${model.FZJC }"/>">
												<span class="print_text"><c:out value="${model.FXMMC }"/></span>
											</label>
										</td>
										</tr>
									</c:when>
								<c:otherwise>
									<td class="print_td">
										<label class="">
											<input type="checkbox" id="content_<c:out value="${model.FZJC }"/>" name="Model" value="<c:out value="${model.FZJC }"/>">
											<span class="print_text"><c:out value="${model.FXMMC }"/></span>
										</label>
									</td>
								</c:otherwise>
								</c:choose>
							</c:forEach>
						</table>
					</td>
				</tr>
				
				<tr>
					<td><input type="checkbox" name="" value="1"/>需要邮寄</td>
					<td colspan=3> 
						<textarea class="textarea" id="" name="" style="resize:none;margin-left:-10px;width:95%;height:50px;"></textarea>
					</td> 
				</tr>
				<tr>
					<td>身份证号</td>
					<td colspan=3>
						<span style="margin-left:-10px;"></span><input type="text" id="" class="easyui-textbox"  data-options ="width:'78%',height:24">
					    <span style="margin-left:1%;"></span><a href="#" id="" class="easyui-linkbutton" onclick="readCert()">读 卡</a>
					</td> 
				</tr>
				
				<tr>
					<td colspan=4 style="text-align:center;">
					     <a href="#" class="easyui-linkbutton" onclick="printPage()">打印申请单</a>&nbsp;&nbsp;
					     <span class="paddingL"></span><a href="#" class="easyui-linkbutton" onclick="register()">确认登记</a>&nbsp;&nbsp;
					     <span class="paddingL"></span><a href="#" class="easyui-linkbutton" onclick="returnQuery()">返 回</a>
					     <a href="#" class="easyui-linkbutton" id="" onClick="openChargeDialog()" style="">收 费</a>
						 <!-- <span class="paddingL"></span><a href="#" class="easyui-linkbutton" onclick="returnQuery()">返 回</a> -->
					</td>
				</tr>
		   </table>
		    
		  
		 <!-- 高拍仪窗口 start-->
		 <!-- 分辨率 -->
		<select id="printResolution" name="Resolution" style="display:none;" ></select>
		<textarea name="content" cols="30" rows="6" id="printContent" style="display:none;"></textarea>
		<input type="checkbox" name="PrintCheckReduceShadow" style="display:none;" id="PrintCheckReduceShadow" onclick="SetResuceShadow()"/>
	  	<!-- 标记为多页源 -->
		<input type="checkbox" style="display:none;" name="PrintcheckMultiSource" id="PrintcheckMultiSource"/>
		<label class="generalFont" style="display:none;">去除阴影</label>
		<label  class="generalFont" style="display:none;">文档变形修补</label>
		<select name="PrintCammeraType" id="PrintCammeraType" style="display:none;">
          <option value ="0" selected="selected">文档摄像头</option>
          <option value ="1">人像摄像头</option>
          <option value ="2">双摄像头</option>
        </select>
		 <div class="easyui-dialog" id="printCameroDialog" data-options="closed:true,resizable:true" style="width:650px;height:600px;">
			 <p style="text-align:center;">
			 	<a href="#" class="easyui-linkbutton" onclick="PrintCaptureToFile()">拍摄</a>
			 	<a href="#" class="easyui-linkbutton" onclick="PrintSetDeviceRotation(90)" >旋 转</a>&nbsp;&nbsp; 
				<a href="#" class="easyui-linkbutton" onclick="PrintSetDeviceRotation(180)" >上下旋转</a>&nbsp;&nbsp; 
				<span style="display:none;" id="printMark" data-attr = ""></span>
			 </p> 
			 <div style="width:100%;height:95%" align="center">	
				<object id="printCapture" style ="width: 100%;height: 100%;" align="center" classid="clsid:9A73DB73-2CA3-478D-9A3F-7E9D6A8D327C">
				<!-- 如果要指定cab包和/或版本号参照以下示例 -->
				<!-- object id="Capture" style ="width: 99%;height: 550px;border: 5 gray solid;" align="middle" classid="clsid:9A73DB73-2CA3-478D-9A3F-7E9D6A8D327C" codebase="CaptureVideo.cab#version=1,7,8,0" -->
			    </object>
		     </div>
		 </div>
		 <!-- 高拍仪窗口 end-->
		 
		 <!-- 打印收费窗口 start -->
		    <div id="scanningCharge" class="easyui-dialog" data-options="closed:true">
			  <div  class="easyui-layout" style="width:800px;height:500px;">
					<div data-options="region:'west'" style="width:30%;height:310px;" class="Cancel_borderTL">
						<div class="headtags">患者信息 </div> 
						<p><label class="spanPaddwidth shootFontBold">病案号：</label><label class="dFprn"></label></p>
						<p><label class="spanPaddwidth shootFontBold">住院次数：</label><label class="dFtimes"></label></p>
						<p><label class="spanPaddwidth shootFontBold">姓名：</label><label class="dFname"></label></p>
						<p><label class="spanPaddwidth shootFontBold">出院日期：</label><label class="dFcydate"></label></p>
						<p><label class="spanPaddwidth shootFontBold">出院科室：</label><label class="dFcydept"></label></p>
					</div>
					<div data-options="region:'east'" style="width:70%;height:310px;margin-left:10px;" class="Cancel_borderTR">
						 
						    <div class="headtags">复印信息</div>  
						    <table style="width:98%;" cellspacing="10">
						        <tr> 
									<td>是否打印</td> 
									<td>
										<input type="radio" checked="checked" name="dy" value="0" />打印
										<span style="margin-left:5px"></span>
										<input type="radio" name="dy" value="1" />复印
						            </td>
						            <td>色&nbsp;&nbsp;彩 </td>
						            <td> 
										 <input type="radio" checked="checked" name="sc" value="0">黑白
										 <span style="margin-left:5px"></span>
										 <input type="radio" name="sc" value="0">彩色
									</td>
							    </tr>  
							    
								<tr>
									<td>打印内容</td>
									<td colspan=3 style="width:300px;border:0px solid #a9a9a9">
									   <textarea class="textarea" id="" name="" style="resize:none;width:415px;height:50px;"></textarea>
									</td>
								</tr>
								
								<tr>
									<td><input type="checkbox" name="" value="1"/>需要邮寄</td>
									<td colspan=3> 
										<textarea class="textarea" id="" name="" style="width:415px;height:50px;"></textarea>
									</td> 
								</tr> 
							</table>
							
							<p class="headtags" style="border-top: 1px solid #dad9d9;">费用信息 </p>  
							 <table style="width:98%;" cellspacing="10">
								<tr>
									<td class="shootFontBold">收费标准</td>
									<td>
										<select id="" class="easyui-combobox" name="" data-options="precision:2,width:120,height:24">
											<option value="0" selected="selected">按页收费</option>
											<option value="1">按张收费</option>
										</select>
									</td>
									
									<td class="shootFontBold">病历单价</td>
									<td>
									    <input id="singel" class="easyui-numberbox" data-options="width:120,height:24,min:1,panelHeight:'auto',readonly:false"/>
										<label>元</label>
									</td>
								</tr>
							 
								<tr>
								    <td class="shootFontBold">打印份数</td>
									<td>
									  <input id="printCopies" class ="easyui-numberbox" data-options ="width:120,height:24,min:1,panelHeight:'auto',readonly:false"/>
									  <label>份</label>
									</td>
									<td class="shootFontBold">病历页数</td>
									<td>
									  <input id="printPage" class ="easyui-numberbox" data-options ="width:120,height:24,min:1,panelHeight:'auto',readonly:false"/>
								      <label>页</label>
									</td>
								</tr>
								<tr>
									<td class="shootFontBold">小计(￥)</td>
									<td>
									 <input id="" class ="easyui-numberbox" data-options ="width:120,height:24,min:1,panelHeight:'auto',readonly:true"/>
									 <label id="lititTotal">元</label>
									</td>
									<td class="shootFontBold">其它费用(￥)</td>
									<td>
									  <input id="" class ="easyui-numberbox" data-options ="width:120,height:24,min:1,panelHeight:'auto',readonly:false"/>
									  <label id="otherTotal">元</label>
									</td>
								</tr>
								
						        <tr>
						           <td colspan=4 class="shootFontBold" style="padding-top:20px;padding-right:30px;text-align:right;">总金额(￥)&nbsp;&nbsp;
							       <label id="ChargeTotal" style="font-size:16px;font-weight:bolder;color:#0fe80f;">0.00</label>&nbsp;&nbsp;元 
					 			</tr>
					 			
					 			<tr>
						           <td class="shootFontBold">实收(￥)</td>
							       <td> 
							         <input id="" style="width:110px;height:26px;font-size:18px;font-weight:bolder"/>&nbsp;元
					 			   </td>
					 			 
						           <td colspan=2 class="shootFontBold" style="padding-top:15px;padding-right:30px;text-align:right;">找零(￥)&nbsp;&nbsp; 
							           <label id="changeTotal" style="font-size:16px;font-weight:bolder;color:red;">0.00</label>&nbsp;&nbsp;元 
					 			   </td>
					 			</tr>
					 			
					 </table> 	 
				 </div>
			 </div>
		</div>
		<!-- 打印收费窗口 end -->
	  </div>
	
	  <div  data-options="region:'east',collapsible:false,title:'证件读取'" style="height:100%;width:36%;">
		 	<!-- <label>证件读取</label> -->
		 	<span style="padding-bottom:10px;">
		 		<span style="padding-top:10px;padding-left:5px;"> 
					<select id="" class="easyui-combobox" name="" style="width:190px;">
						<option value="0" selected="selected">代理人身份证</option>
		           		<option value="1" >工作证</option>
		           		<option value="2" >居住证</option>
		           		<option value="3" >港澳通行证</option>
		           		<option value="4" >患者身份证</option>
		           		<option value="5" >其他证件</option>
		            </select>
	            </span>
	            <span style="padding-top:10px;padding-left:5px;width:190px;"> 
		             <a href="#" class="easyui-linkbutton" onclick="printOpenDevice(PrintCammeraType.value)">拍摄</a> 
		             <a href="#" class="easyui-linkbutton" onclick="repeatPicture()">重拍</a> 
		             <a href="#" class="easyui-linkbutton" onclick="deleteImage()">删除</a> 
			    </span>
			</span> 
		 	<ul id="picArea" style="height:95%;">
				<li class="print_li"><img id="picture1" name="pic1" class="pic1" style="height:100%;width:100%;"/></li>
				<li class="print_li"><img id="picture2" name="pic1" class="pic2" style="height:100%;width:100%;"/></li>
				<li class="print_li"><img id="picture3" name="pic1" class="pic3" style="height:100%;width:100%;"/></li>
				<li class="print_li"><img id="picture4" name="pic1" class="pic4" style="height:100%;width:100%;"/></li>
			</ul>
			<!-- <div id="PrintMenu" class="easyui-menu" style="width:120px;">
				<div onclick="repeatPicture(obj,claName)" data-options="">重 拍</div>
			</div> -->
	 </div>
</div>
	
<script type="text/javascript" src='<%=request.getContextPath()%>/js/Print/PrintScanning.js'></script>
<script type="text/javascript">
 	$(".register_fprn").html('<%=request.getParameter("fprn")%>');
	$(".register_fzyid").html('<%=request.getParameter("fzyid")%>');
	$(".register_fsex").html(decodeURI('<%=request.getParameter("fsex")%>'));
	$(".register_fcydate").html('<%=request.getParameter("fcydate")%>');
	$(".register_frydate").html('<%=request.getParameter("frydate")%>');
	$(".register_fcybs").html(decodeURI('<%=request.getParameter("fcybs")%>'));
	$(".register_fcydept").html(decodeURI('<%=request.getParameter("fcydept")%>'));
	$(".register_fname").html(decodeURI('<%=request.getParameter("fname")%>'));
	$(".register_fidcard").html('<%=request.getParameter("fidcard")%>');
	$(".register_ftimes").html('<%=request.getParameter("ftimes")%>');
	$(function(){
		init(); //初始化高拍仪
		 $(".dlr").css("display","none");
		//获取与患者关系字段
		$("#printRegister_relation").combobox({
			url:ctx + "/Print/queryRelation",
			valueField:"FZJC",
			textField:"FMC"
		});
		
		//获取复印类型
		$("#printRegister_type").combobox({
			url:ctx + "/Print/getPrintType",
			valueField:"ffynrzjc",
			textField:"fname"
		});
		
		
	});
	
	//选中图片赋予样式
	$(".print_li").click(function(){
		$(this).addClass("print_event_style").siblings().removeClass("print_event_style");
	});
		
	//删除图片
	function deleteImage(){
		var li = $("#picArea>li");
		if(li.is(".print_event_style") == false){
			$.messager.alert("提示","请选中要删除的图片","info");
			return;
		}
		if($(".print_event_style").find("img").prop("src") != ""){
			$(".print_event_style").find("img").prop("src","");
		}else{
			$.messager.alert("提示","没有可删除的图片","info");
			return;
		}
		
	}
	
//重拍
function repeatPicture(){
	var li = $("#picArea>li");
	if(li.is(".print_event_style") == false){
		$.messager.alert("提示","请选中要重拍的图片","info");
		return;
	}
	if($(".print_event_style").find("img").prop("src") != ""){
		$(".print_event_style").find("img").prop("src","");
		$("#printMark").prop("data-attr","true"); //给一个表示，表示当前操作为重拍
		$("#printCameroDialog").dialog({
			maximizable:true,
			closed: false,
			modal: true,
			title: "拍摄",
			buttons:[{
				text:"取消",
				iconCls:'',
				handler:function(){
					$('#printCameroDialog').dialog("close");
				}
			}]
		});
	}else{
		$.messager.alert("提示","没有可重拍的图片","info");
		return;
	}
}


 </script>
</body>
</html>